home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / mini / DPT-Hardware-RAID < prev    next >
Text File  |  1998-01-05  |  12KB  |  298 lines

  1.   Linux DPT Hardware RAID HOWTO
  2.   Ram Samudrala (me@ram.org)
  3.   v1.1,  December 15, 1997
  4.  
  5.   How to set up hardware RAID under Linux.
  6.  
  7.   1.  Introduction
  8.  
  9.   This document describes how to set up SCSI hardware RAID, focusing
  10.   mainly on host-based adapters from DPT, though the principles applied
  11.   here are fairly general.
  12.  
  13.   Use the information below at your own risk.  I disclaim all
  14.   responsibility for anything you may do after reading this HOWTO. The
  15.   latest version of this HOWTO will always be available at
  16.   http://www.ram.org/computing/linux/dpt_raid.html.
  17.  
  18.   2.  Supported controllers
  19.  
  20.   Currently the only well-supported host-based hardware RAID controller
  21.   (i.e, a controller for which there exists a driver under Linux) is one
  22.   that is made by DPT <http://www.dpt.com>. However, there exist other
  23.   host-based and scsi-to-scsi controller which may work under Linux.
  24.   These include the ones made by Syred <http://www.syred.com>, ICP-
  25.   Vortex <http://www.icp-vortex.com>, and BusLogic <http://www.bus-
  26.   logic.com>.  In addition, there exist plenty of SCSI-to-SCSI
  27.   controllers. See the RAID solutions for Linux page
  28.   <http://linas.org/linux/raid.html> for more info.
  29.  
  30.   If, in the future, there is support for other drivers, I will do my
  31.   best to incorporate that information into this HOWTO.
  32.  
  33.   3.  What hardware should be used?
  34.  
  35.   Given all these options, if you're looking for a RAID solution, you
  36.   need to think carefully about what you want.  Depending on what you
  37.   want to do, and which RAID level you wish to use, some cards may be
  38.   better than others.  SCSI-to-SCSI adapters may not be as good as host-
  39.   based adapters, for example (see the DPT comparison between host-based
  40.   and SCSI-to-SCSI adapters <http://www.dpt.com/hstvscsi.html> for why
  41.   this is the case).  Michael Neuffer (neuffer@kralle.zdv.uni-mainz.de),
  42.   the author of the EATA-DMA driver, has a nice discussion about this on
  43.   his Linux High Performance SCSI and RAID page <http://www.uni-
  44.   mainz.de/~neuffer/scsi/>.
  45.  
  46.   For the purposes of this HOWTO, I am assuming you have only a Linux
  47.   system running. Also, note that I've only tried this out with the DPT
  48.   Smartcache VI PM2144UW controller, with the DPT-supplied enclosure
  49.   (SmartRAID tower), and I have no experience with other set ups. So
  50.   things may be different for your setup.
  51.  
  52.   4.  Installation
  53.  
  54.   4.1.  Installing and configuring the hardware
  55.  
  56.   Refer to the instruction manual to install the card and the drives.
  57.   For DPT, since a storage manager for Linux doesn't exist yet, you need
  58.   to create a MS-DOS-formatted disk with the system on it (usually
  59.   created using the command "format \s" at the MS-DOS prompt).  You will
  60.   also be using the DPT storage manager for MS-DOS, which you should
  61.   probably make a copy of for safety.
  62.  
  63.   Once the hardware is in place, boot using the DOS system disk. Replace
  64.   the DOS disk with the storage manager. And invoke the storage manager
  65.   using the command:
  66.  
  67.        a:\ dptmgr
  68.  
  69.   Wait a minute or so, and you'll get a nice menu of options.  Configure
  70.   the set of disks as a hardware RAID (single logical array). Choose
  71.   "other" as the operating system.
  72.  
  73.   The MS-DOS storage manager is a lot easier to use with a mouse, and so
  74.   you might want to have a mouse driver on the initial system disk you
  75.   create.
  76.  
  77.   Technically, it should be possible to run the SCO storage manager
  78.   under Linux, but it may be more trouble than its worth.  It's probably
  79.   more easier to run the MS-DOS storage manager under Linux.
  80.  
  81.   4.2.  Configuring the kernel
  82.  
  83.   You will need to configure the kernel with SCSI support and the
  84.   appropriate low level driver.  See the Kernel HOWTO
  85.   <http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html> for information
  86.   on how to compile the kernel. Once you choose "yes" for SCSI support,
  87.   in the low level drivers section, select the driver of your choice
  88.   (EATA-DMA for most EATA-DMA compliant (DPT) cards, EATA-PIO for the
  89.   very old PM2001 and PM2012A from DPT).  Most drivers, including the
  90.   EATA-DMA driver, should be available in recent kernel versions.
  91.  
  92.   Once you have the kernel compiled, reboot, and if you've set up
  93.   everything correctly, you should see the driver recognising the RAID
  94.   as a single SCSI disk. If you use RAID-5, you will see the size of
  95.   this disk to be 2/3 of the actual disk space available.  The messages
  96.   you see upon bootup should look something like this:
  97.  
  98.        EATA (Extended Attachment) driver version: 2.59b
  99.        developed in co-operation with DPT
  100.        (c) 1993-96 Michael Neuffer, mike@i-Connect.Net
  101.        Registered HBAs:
  102.        HBA no. Boardtype    Revis  EATA Bus  BaseIO IRQ DMA Ch ID Pr QS  S/G IS
  103.        scsi0 : PM2144UW     v07L.Y 2.0c PCI  0xef90  11 BMST 1  7  N  64 252 Y
  104.        scsi0 : EATA (Extended Attachment) HBA driver
  105.        scsi : 1 host.
  106.          Vendor: DPT       Model: RAID-5            Rev: 07LY
  107.          Type:   Direct-Access                      ANSI SCSI revision: 02
  108.        Detected scsi disk sda at scsi0, channel 0, id 8, lun 0
  109.        scsi0: queue depth for target 8 on channel 0 set to 64
  110.        scsi : detected 1 SCSI disk total.
  111.        SCSI device sda: hdwr sector= 512 bytes. Sectors= 35591040 [17378 MB] [17.4 GB]
  112.  
  113.   (The above display is for a setup with a single DPT SCSI controller,
  114.   configured as RAID-5, with three disks of 9 GB each.)
  115.  
  116.   5.  Usage
  117.  
  118.   5.1.  fdisk, mke2fs, mount, etc.
  119.  
  120.   You can now start treating the RAID as a regular disk. The first thing
  121.   you'll need to do is partition the disk (using fdisk).  You'll then
  122.   need to set up an ext2 filesystem.  This can be done by running the
  123.   command:
  124.  
  125.        % mkfs -t ext2 /dev/sdxN
  126.  
  127.   where /dev/sdxN is the name of the SCSI partition.  Once you do this,
  128.   you'll be able to mount the partitions and use them as you would any
  129.   other disk (including adding entries in /etc/fstab).
  130.  
  131.   5.2.  Hotswapping
  132.  
  133.   We first tried to test hotswapping by removing a drive and putting it
  134.   back in the DPT-supplied enclosure/tower (which you buy for an
  135.   additional cost).  Before we could carry this out to completion, one
  136.   of the disks failed (as I write this, the beeping is driving me
  137.   crazy). Even though one of the disks failed, all the data on the RAID
  138.   drive is accessible.
  139.  
  140.   Instead of replacing the drive, we just went through the motions and
  141.   put the same drive back in.  The drive rebuilt itself and everything
  142.   seems to be okay.  During the time the disk had filed, and during the
  143.   rebuilding process, all the data was accessible. Though it should be
  144.   noted that if another disk had failed, we'd have been in serious
  145.   trouble.
  146.  
  147.   5.3.  Performance
  148.  
  149.   Here's the output of the Bonnie program, on a 2144 UW with 9x3=17 GB
  150.   RAID 5 setup. The RAID is on a dual processor Pentium Pro machine
  151.   running Linux 2.0.32. For comparison, the Bonnie results for the IDE
  152.   drive on that machine are also given.
  153.  
  154.                   -------Sequential Output-------- ---Sequential Input--  --Random--
  155.                   -Per Char- --Block--- -Rewrite-- -Per Char- --Block---  --Seeks---
  156.                MB K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU K/sec %CPU   /sec  %CPU
  157.        RAID   100  9210 96.8  1613  5.9   717  5.8  3797 36.1 90931 96.8 4648.2 159.2
  158.        IDE    100  3277 32.0  6325 23.5  2627 18.3  4818 44.8 59697 88.0  575.9  16.3
  159.  
  160.   It's clear that the RAID is great for block reads and writes (even
  161.   though write performance is degraded by using RAID-5), but it is not
  162.   very good at sequential re-writes.
  163.  
  164.   6.  Features in the DPT RAID driver
  165.  
  166.   This section describes some of the commands available under Linux to
  167.   check on the RAID configuration.  Again, while references to the
  168.   eata_dma driver is made, this can be used to check up on any driver.
  169.  
  170.   To see the configuration for your driver, type:
  171.  
  172.        % cat /proc/scsi/eata_dma/N
  173.  
  174.   where N is the host id for the controller.  You should see something
  175.   like this:
  176.  
  177.        EATA (Extended Attachment) driver version: 2.59b
  178.        queued commands:         353969
  179.        processed interrupts:    353969
  180.  
  181.        scsi0 : HBA PM2144UW
  182.        Firmware revision: v07L.Y
  183.        Hardware Configuration:
  184.        IRQ: 11, level triggered
  185.        DMA: BUSMASTER
  186.        CPU: MC68020 20MHz
  187.        Base IO : 0xef90
  188.        Host Bus: PCI
  189.        SCSI Bus: WIDE Speed: 10MB/sec.
  190.        SCSI channel expansion Module: not present
  191.        SmartRAID hardware: present.
  192.            Type: integrated
  193.            Max array groups:              7
  194.            Max drives per RAID 0 array:   7
  195.            Max drives per RAID 3/5 array: 7
  196.        Cache Module: present.
  197.  
  198.            Type: 0
  199.            Bank0: 16MB without ECC
  200.            Bank1: 0MB without ECC
  201.            Bank2: 0MB without ECC
  202.            Bank3: 0MB without ECC
  203.        Timer Mod.: present
  204.        NVRAM     : present
  205.        SmartROM  : enabled
  206.        Alarm     : on
  207.        Host<->Disk command statistics:
  208.                 Reads:      Writes:
  209.            1k:           0            0
  210.            2k:           0            0
  211.            4k:           0            0
  212.            8k:           0            0
  213.           16k:           0            0
  214.           32k:           0            0
  215.           64k:           0            0
  216.          128k:           0            0
  217.          256k:           0            0
  218.          512k:           0            0
  219.         1024k:           0            0
  220.        >1024k:           0            0
  221.        Sum   :           0            0
  222.  
  223.   To get advanced command statistics, type:
  224.  
  225.        % echo "eata_dma latency" > /proc/scsi/eata_dma/N
  226.  
  227.   Then you can do a:
  228.  
  229.        % cat /proc/scsi/eata_dma/N
  230.  
  231.   to get more detailed statistics.
  232.  
  233.   To turn off advanced command statistics, type:
  234.  
  235.        % echo "eata_dma nolatency" > /proc/scsi/eata_dma/N
  236.  
  237.   7.  Troubleshooting
  238.  
  239.   7.1.  Upon bootup, no SCSI hosts are detected
  240.  
  241.   This could be due to several reasons, but it's probably because the
  242.   appropriate driver is not configured in the kernel. Check and make
  243.   sure the appropriate driver (EATA-DMA for most DPT cards) is
  244.   configured.
  245.  
  246.   7.2.  RAID configuration shows up as N different disks
  247.  
  248.   The RAID has not been configured properly.  If you're using a DPT
  249.   storage manager, you need to configure the RAID disks as a single
  250.   logical array.  Michael Neuffer (neuffer@kralle.zdv.uni-mainz.de)
  251.   writes "When you configure the controller with the SM start it with
  252.   the parameter /FW0 and/or select Solaris as OS. This will cause the
  253.   array to be setup to be managed internally by the controller."
  254.  
  255.   7.3.  If all fails...
  256.  
  257.   Read the SCSI-HOWTO again.  Check the cabling and the termination.
  258.   Try a different machine if you have access to one.  The most common
  259.   cause of problems with SCSI devices and drivers is because of faulty
  260.   or misconfigured hardware.  Finally, you can post to the various
  261.   newsgroups or e-mail me, and I'll do my best to get back to you.
  262.  
  263.   8.  References
  264.  
  265.   The following documents may prove useful to you as you set up RAID:
  266.  
  267.   ╖  DPT RAID Primer and other RAID/SCSI-related documents
  268.      <http://www.dpt.com/techno.html>
  269.  
  270.   ╖  EATA-DMA homepage <http://www.uni-
  271.      mainz.de/~neuffer/scsi/dpt/index.html>
  272.  
  273.   ╖  Linux Disk HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Disk-HOWTO.html>
  274.  
  275.   ╖  Linux Kernel HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Kernel-
  276.      HOWTO.html>
  277.  
  278.   ╖  Linux SCSI HOWTO <http://sunsite.unc.edu/mdw/HOWTO/SCSI-HOWTO.html>
  279.  
  280.   ╖  RAID Solutions for Linux <http://linas.org/linux/raid.html>
  281.  
  282.   9.  Acknowledgements
  283.  
  284.   The following people have been helpful in getting this HOWTO done:
  285.  
  286.   ╖  Boris Fain (fain@zen.stanford.edu)
  287.  
  288.   ╖  Jos Vos (jos@xos.nl)
  289.  
  290.   ╖  Michael Neuffer (neuffer@kralle.zdv.uni-mainz.de)
  291.  
  292.   ╖  Ralph Wallace (rwallace@rwallace.interaccess.com)
  293.  
  294.   ╖  Russell Brown (russell@lutton.lls.com)
  295.  
  296.   ╖  Syunsuke Ogata (Syunsuke_Ogata@appear.ne.jp)
  297.  
  298.